package adv1;

/**
 * @author oldliu
 * @since 1.0
 */
public class Calc {
    public int add(int []ar){
        return 0;
    }
    public int jia(int ...a){
        int sum=0;
        for (int k:a){
            sum+=k;
        }
        return sum;
    }
    public int chen(int ...a){
        if(a.length==0)
            return 0;
        int sum=1;
        for (int k:a){
            sum*=k;
        }
        return sum;
    }
    //乘法

    public static void main(String[] args) {
        Calc c=new Calc();
        int he = c.jia(10, 20, 30);
        System.out.println(he);
        he=c.jia(100);
        System.out.println(he);
        he=c.jia();
        System.out.println(he);
        String name="范德是";
        int age=19;
        String phone="131494994934";
        String format = String.format("这个同学叫%s,年龄是%d,QQ号是%s"
                , name, age, phone);
        System.out.println(format);
    }
}
